﻿package {
	import flash.display.MovieClip;
	import flash.events.*;
	import flash.text.*;
	import flash.display.Shape;

	public class NewList extends MovieClip {
		public var hjtel:TextField;//获奖电话   
		public var hjdate:TextField;//获奖日期   
		public var hjname:TextField;//获奖姓名
		public var dataprovider:XML;//指定数据源   
		private var format:TextFormat;
		private var shape:Shape;
		public function NewList() {

			format=new TextFormat();
			format.color=0x000000;
			format.size=15;

			hjname=new TextField();
			

			hjtel=new TextField();
			hjtel.x=230;
			hjtel.y=0;
			hjtel.width=319;
			hjtel.height=20;
			hjtel.setTextFormat(format);
			hjtel.addEventListener(MouseEvent.MOUSE_DOWN,onDown);
			hjtel.addEventListener(MouseEvent.MOUSE_OUT,onOut);
			hjdate=new TextField();
			hjdate.x=10;
			hjdate.y=0;
			hjdate.width=81;
			hjdate.height=20;
			hjdate.setTextFormat(format);
			addChild(hjdate);
			addChild(hjtel);
			hjname.x=120;
			hjname.y=0;
			hjname.height=20;
			hjname.setTextFormat(format);
addChild(hjname);
			DrawLine();//画下滑线   

		}
		private function DrawLine():void {
			var shape:Shape=new Shape();
			shape.graphics.lineStyle(0.5,0,1);
			shape.graphics.moveTo(0,21);
			shape.graphics.lineTo(320,21);
			addChild(shape);
		}
		private function onDown(event:MouseEvent):void {
			var evt:TextEvent=new TextEvent(TextEvent.LINK);
			evt.text=hjname.text;
			this.dispatchEvent(evt);
		}

		private function onOut(event:MouseEvent):void {
			hjtel.textColor=0x000000;
		}
	}
}